
public class GoToJail extends Block {
	private int position;
	private int previousPosition;
	public boolean isinJail=false;
	
	public GoToJail(int blocknumber){
		super(blocknumber);
		
		
	}
	
	public void setinJail(boolean kulong){
		this.isinJail=kulong;
		this.setPosition(10, true);
		this.setPreviousPosition();
	}
	
	public boolean getIsInJail(){
		return isinJail;
	}
	
	public void setPosition2(int x){
		this.position=x;
	}
	
	public void setPosition(int x, boolean jail){
		if(this.isinJail==false){
		if(jail==false){
		this.position = this.position+x;
		if(position>39){
		int y;
		y=this.position-40;
		this.position = y;
		}
		}
		}else{
			if(jail==true){
			this.position=x;
			System.out.println(this.position);
			}
		}
		
	}
	
	public int getPosition(){
		return position;
	}
	
	public void setPreviousPosition(){
		previousPosition = position;
		}

		public int getPrevPostition(){
		return previousPosition;
		}
}
